﻿package 华为机试;

import java.util.Scanner;

public class 华为机试第一题 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String s = sc.nextLine();
            System.out.println(func(s));
        }
        sc.close();
    }

    private static String func(String s) {
        String[] a = s.split(",");
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < a.length; i++) {
            char[] ch = a[i].toCharArray();
            for (int j = ch.length - 1; ch[j] != 'x'; j--) {
                if (ch[j] != 'F')
                    sb.append(ch[j]);
            }
        }
        return sb.toString();
    }

}
